let api = module.exports = {};

let http = require('../Base/HttpManager');

/**
 * 获取系统信息
 * @param {*} cbSuccess 
 * @param {*} cbFail 
 */
api.getSystemInfo = function (cbSuccess, cbFail) {
    let route = "/index.php/api/index/getSystemInfo";
    http.get(route,{},cbSuccess,cbFail);
};

/**
 * 账号密码登录
 * @param {*} data 
 * @param {*} cbSuccess 
 * @param {*} cbFail 
 */
 api.login = function(data,cbSuccess,cbFail=null){
    let route = "/index.php/api/user/login";
    http.post(route,data,cbSuccess,cbFail);
};

/**
 * 用户注册
 * @param {*} data 
 * @param {*} cbSuccess 
 * @param {*} cbFail 
 */
api.register = function(data,cbSuccess,cbFail=null){
    let route = "/index.php/api/user/register";
    http.post(route,data,cbSuccess,cbFail);
};

/**
 * 获取用户信息
 * @param {*} cbSuccess 
 * @param {*} cbFail 
 */
api.getUserInfo = function(cbSuccess,cbFail=null){
    let route = "/index.php/api/user/getUserInfo";
    http.get(route,{},cbSuccess,cbFail);
};
